all: .build .build/bulletheck_win64.zip .build/bulletheck.love .build/bulletheck.zip

.build:
	mkdir .build

.build/bulletheck_win64.zip: .build/bulletheck.love .build/love-11.1-win64.zip
	cd .build; \
	rm -r love-11.1.0-win64 || true; \
	rm -r bulletheck_win64 || true; \
	unzip love-11.1-win64.zip; \
	cd love-11.1.0-win64; \
	cat love.exe ../bulletheck.love > bulletheck.exe; \
	rm love.exe lovec.exe; \
	cp ../../LICENSE GAME_LICENSE; \
	cd ..; \
	mv love-11.1.0-win64/ bulletheck_win64; \
	zip -r bulletheck_win64.zip bulletheck_win64

.build/bulletheck.zip: .build/bulletheck.love
	cd .build; \
		rm -r bulletheck || true; \
		mkdir bulletheck || true; \
		cp ../LICENSE bulletheck.love bulletheck; \
		zip -r bulletheck.zip bulletheck

.build/bulletheck.love: FORCE
	zip -r .build/bulletheck.love *

.build/love-11.1-win64.zip:
	cd .build; \
	wget https://bitbucket.org/rude/love/downloads/love-11.1-win64.zip

FORCE:
